package kr.co.gasan.bdt;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Order entity.
 */
@Entity
@Table(name="ORDERAPP_ORDERS")
public class Orders implements Serializable {
    
    /**
	 * 
	 */
	private static final long serialVersionUID = -4675154096219109766L;
	
	@Id 
    @GeneratedValue
    private Long id;
    @ManyToOne
    private Customer customer;
    @ManyToMany
    @JoinTable(name="ORDERAPP_ORDERS2ITEMS")
    private Collection<Item> items;
    
    public Orders() {}
    
    public Long getId() {return id;}
    
    public void setId(Long id) {this.id = id;}
    
    public Customer getCustomer(){return customer;}
    
    public void setCustomer(Customer c){this.customer = c;}
    
    public Collection<Item> getItems(){return items;}
    
    public void setItems(Collection<Item> items){this.items = items;}
}